package org.syntaxlisp.core.element;

/**
 * @author HuangYijun
 * @data 2023-01-29 10:49
 **/
public class StringElement extends SyntaxLispElement {

    public StringElement(String val) {
        super(SyntaxLispElementType.STRING, val);
    }

    @Override
    public boolean equalsTo(SyntaxLispElement o) {
        return o.getVal().equals(getVal());
    }

    @Override
    public int hashCode () {
        return getVal().hashCode();
    }

    @Override
    public SyntaxLispElement copy() {
        return (new StringElement(getVal())).copyMatchPropertiesAndReturn(this);
    }

}
